1. Field of the Invention
The present invention relates to a data storage device with a FLASH memory and an operating method thereof.
2. Description of the Related Art
Today, FLASH memory (e.g., NAND FLASH) is widely used in data storage devices as a storage medium.
FIG. 1A depicts the storage space of a FLASH memory. The FLASH memory 100 may comprise a plurality of physical blocks BLK1, BLK2, and so forth. Each physical block includes a plurality of physical pages. For example, the physical block BLK1 includes physical pages Page1, Page2, and so forth.
According to operating characteristics of a FLASH memory, an erase operation is required to release the space of the FLASH memory. An erase operation has to be performed on an entire block. FIG. 1B depicts the data update for a particular logical address. In the physical block BLK, the old data in space Data_Old becomes invalid when the update data is stored in a spare space Data_New. Because the reuse of the space Data_Old requires an erase operation to be performed on the entire physical block BLK, a valid data collection operation (as known as garbage collection) has to be performed on the physical block BLK prior to the erase operation. After collecting all valid data within the physical block BLK (e.g. data in Data_New) to other physical blocks, the physical block BLK is erasable to be released as a free block.
There are several modes to allocate the storage space of the FLASH memory 100. Typically, the FLASH memory 100 may be allocated according to a block mapping mode or a page mapping mode. FIG. 1C shows that according to a block mapping mode, a physical block (as that defined in FIG. 1A) is allocated to map to a series of consecutive logical addresses at the host for data storage. The series of consecutive logical addresses may form a logical block, which is numbed by “LBN,” a logical block number. In the block mapping mode, the data indicated by the series of consecutive logical addresses is written into the physical block page by page in the order of the logical addresses (i.e. sequential in the logical address). Thus, when looking up for a physical space corresponding to a logical address, a block mapping table may be referred to first to find the physical block corresponding to the logical block number (LBN) of the logical address, and then the physical page for the logical address is found from the physical block according to a page offset of the logical address. Note that according to the block mapping mode, data is written into a physical block in sequential according to logical addresses. The valid data collection operation, therefore, is frequently performed and results in a considerable burden on the operation efficiency of the FLASH memory. As for the page mapping mode, the sequential write based on the logical addresses is not necessary and each physical block does not particularly correspond to a series of consecutive logical addresses. However, an enormous page mapping table is required to look up to find the physical page for each logical address, wherein the mapping relation of each logical address to each corresponding physical address needs storing in the page mapping table. The resource consumption is still considerable due to huge storage space for the large-sized mapping table as well as the wide search over the mapping table. How to improve the operation efficiency of a FLASH memory without the aforementioned defects of the block mapping and the page mapping modes is an important issue in the field.